package ace.module.account.sdk.core.feign.impl;

import ace.cmp.core.model.R;
import ace.cmp.openfeign.security.oauth2.core.config.FeignInternalServerOauth2SecurityConfig;
import ace.module.account.api.model.dto.IamAccountProfileDto;
import ace.module.account.sdk.core.feign.IamAccountProfileFeignApi;
import ace.module.common.api.annotation.ApiRemoteProxyPriority;
import jakarta.validation.Valid;
import jakarta.validation.constraints.NotNull;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import ace.module.account.sdk.core.constant.SdkConstant;

/**
* 账户个人资料 rpc feign.
*
* @author Caspar
*/
@FeignClient(
    name = "${spring.cloud.openfeign.client.config.iamAccountProfileFeign.name:" + SdkConstant.FEIGN_SERVICE_NAME + "}",
    contextId = "iamAccountProfileFeign",
    path = IamAccountProfileFeign.PATH,
    configuration = FeignInternalServerOauth2SecurityConfig.class,
    primary = false
)
@ApiRemoteProxyPriority
public interface IamAccountProfileFeign extends IamAccountProfileFeignApi {
  String PATH = "${spring.cloud.openfeign.client.config.iamAccountProfileFeign.path:/account/iam-account-profile/rpc}";

  @GetMapping("/getByAccountId")
  R<IamAccountProfileDto> getByAccountId(@Valid @NotNull @RequestParam("accountId") Long accountId);
}
